package training.ui;

import java.awt.BorderLayout;

import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class SwingTextUI {

	public void simpleUI() {
		
		JFrame myFrame = new JFrame("Java Assignment");
		JLabel myLabel = new JLabel("Math Calculation");
		myFrame.getContentPane().add(myLabel, BorderLayout.NORTH);

		JTextField button1 = new JTextField("20");
		myFrame.getContentPane().add(button1, BorderLayout.WEST);

		JTextField button2 = new JTextField("30");
		myFrame.getContentPane().add(button2, BorderLayout.EAST);

		String[] values = { "add", "multiply", "subtract" };
		JComboBox combo = new JComboBox(values);
		combo.setSelectedIndex(0);

		myFrame.getContentPane().add(combo, BorderLayout.CENTER);

		JLabel button = new JLabel("Output is: 50");
		myFrame.getContentPane().add(button, BorderLayout.SOUTH);

		myFrame.pack();
		myFrame.setVisible(true);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SwingTextUI main = new SwingTextUI();
		main.simpleUI();

	}

}
